package utils;

import java.io.BufferedWriter;
import java.io.File;
import java.io.IOException;

public class BasicFileWriter {
	
	BufferedWriter writer;
	
	public BasicFileWriter(String filename){
		try {
			writer=new BufferedWriter(new java.io.FileWriter(new File(filename)));
		} catch (IOException e) {
			writer=null;
		}
	}
	
	public void writeLine(String line){
		
		if(writer!=null)
			try {
				writer.write(line+"\n");
			} catch (IOException e) {
				e.printStackTrace();
			}
	}
	
	public void close(){
		if(writer!=null)
			try {
				writer.close();
			} catch (IOException e) {
			}
	}
}
